package cn.cq.annotation;

import cn.cq.validator.IsMobileValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})
@Constraint(
        validatedBy = {IsMobileValidator.class}
)
public @interface IsMobile {
    boolean require() default true;
    String message() default "{手机号码格式错误}";
    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
